package com.example.springbootmybatisplus.controller;



import com.example.springbootmybatisplus.mapper.EmpMapper;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


import java.util.List;

@RestController
//@CrossOrigin  解决跨域的注解
public class QueryController {

    //
    @Autowired
    private EmpMapper empMapper;

    @CrossOrigin //解决跨域的注解
    @GetMapping("/querys")
    public List query(){
        System.out.println("接到前端的请求了");

        //调用MP框架中的方法，查询所有

        return empMapper.selectList(null);


    }


}
